import 'dart:convert';

import 'package:dio/dio.dart';
import 'package:flutter/material.dart';
import 'package:shop/config/config.dart';
import 'package:shop/http/HttpUtil.dart';
import 'package:shop/route/my_route.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:shared_preferences/shared_preferences.dart';

import 'OrderDetail.dart';
class MyTask extends StatefulWidget {
  MyTask({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyTask createState() => _MyTask();
}

class _MyTask extends State<MyTask> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text("开工中"),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            Container(
              child:Row(
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: [
                  Container(child: Text("新任务(2)"),decoration: BoxDecoration(border: Border(bottom: BorderSide(width: 1,color: Colors.blue))),padding: EdgeInsets.symmetric(vertical: 10),),
                  Container(child: Text("待取货(3)"),padding: EdgeInsets.symmetric(vertical: 10),),
                  Container(child: Text("待送达(1)"),padding: EdgeInsets.symmetric(vertical: 10),),
                ],
              )
            ),
            Container(
              color: Colors.white,
              padding: EdgeInsets.symmetric(vertical: 10,horizontal: 20),
              child:Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text("客户已等待20分钟"),
                      SizedBox(width: 10,),
                      GestureDetector(
                        child:Container(
                          color: Colors.amberAccent,
                          child: Text("收到任务"),) ,
                      )
                    ],
                  ),
                  Divider(),
                  Row(
                    children: [
                      Container(child: Text("店"),),
                      SizedBox(width: 10,),
                      Column(
                        children: [
                          Text("湖工大乐而乐超市"),
                          Text("黄河北路123号")
                        ],
                      )
                    ],
                  ),
                  Row(
                    children: [
                      Container(child: Text("客"),),
                      SizedBox(width: 10,),
                      Column(
                        children: [
                          Text("幸福大厦"),
                          Text("黄河北路10号")
                        ],
                      )
                    ],
                  ),
                  Divider(),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                    children: [
                      GestureDetector(
                          child:Container(child: Row(children: [Icon(Icons.phone),Text("联系商家")])),
                      onTap: (){

                      },),
                      GestureDetector(
                          child:Container(child: Row(children: [Icon(Icons.phone),Text("导航到商家")])),
                        onTap: (){

                        },),
                     GestureDetector(
                       child: Container(child: Row(children: [Icon(Icons.phone),Text("明细")])),
                       onTap: (){
                         MyRoute.push(OrderDetail());
                       },
                     )
                    ],
                  )
                ],
              )
              ,
            ),
            SizedBox(height: 10,),
            Container(
              color: Colors.white,
              padding: EdgeInsets.symmetric(vertical: 10,horizontal: 20),
              child:Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Text("客户已等待20分钟"),
                      SizedBox(width: 10,),
                      GestureDetector(
                        child:Container(
                          color: Colors.amberAccent,
                          child: Text("收到任务"),) ,
                      )
                    ],
                  ),
                  Divider(),
                  Row(
                    children: [
                      Container(child: Text("店"),),
                      SizedBox(width: 10,),
                      Column(
                        children: [
                          Text("湖工大乐而乐超市"),
                          Text("黄河北路123号")
                        ],
                      )
                    ],
                  ),
                  Row(
                    children: [
                      Container(child: Text("客"),),
                      SizedBox(width: 10,),
                      Column(
                        children: [
                          Text("幸福大厦"),
                          Text("黄河北路10号")
                        ],
                      )
                    ],
                  ),
                  Divider(),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                    children: [
                      Container(child: Row(children: [Icon(Icons.phone),Text("联系商家")],),),
                      Container(child: Row(children: [Icon(Icons.phone),Text("导航到商家")],),),
                      Container(child: Row(children: [Icon(Icons.phone),Text("明细")],),)
                    ],
                  )
                ],
              )
              ,
            )
            ]
        )
      )
    );
  }
}